package com.river.springbootdemo.thinkingjava.enumrated;

/**
 * NO values() method if you upcast an enum
 */
enum Search{
    HITHER,YON;

    @Override
    public String toString() {
        return name();
    }
}

/**
 * @author cxy
 */
public class UpcastEnum {
    public static void main(String[] args) {
        Search[] vals = Search.values();
        //no values() in enum
        Enum e = Search.HITHER;
        for (Enum en:e.getClass().getEnumConstants()){
            System.out.println(en);
        }
    }
}
